<template>
    <view class="userInfo">
        父组件
    </view>
    <Child @click="onClick(a)"></Child>
</template>

<script setup>
import { ref } from 'vue';
let a = ref(1)
defineProps(['onClick'])
</script>

<style lang="scss" scoped>
    .userInfo {
        width: 100%;
        height: 200px;
        background: #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        image {
            width: 100px;
            height: 100px;
            border-radius: 50%;
        }
        .username{
            padding: 10px 0;
            font-size: 20px;
        }
    }
</style>